<template>
    <!-- // LTE基础性能统计_小区(流量自忙时) -->
    <index-card :indexCardTitle="indexCardTitle">
        <el-table :data="tableData" v-loading="loading">
            <el-table-column prop="starttime" label="开始时间" min-width="200">
                <template #default="scope">
                    {{ scope.row.starttime ? formatDateNormal(scope.row.starttime) : null }}
                </template>
            </el-table-column>
            <el-table-column prop="cgi" label="小区CGI" min-width="200" />
            <el-table-column prop="cellName" label="小区名称" min-width="200" />
            <el-table-column prop="cityName" label="地市名称" min-width="200" />
            <el-table-column prop="cityId" label="地市编号" min-width="200" />
            <el-table-column prop="workBandsCn" label="工作频段" min-width="200" />
            <el-table-column prop="mbyteUplaneUl" label="上行流量(MB)" min-width="200" />
            <el-table-column prop="mbyteUplaneDl" label="下行流量(MB)" min-width="200" />
            <el-table-column prop="mbyteUplaneSum" label="总流量(MB)" min-width="200" />
            <el-table-column prop="frruPrbUtilizeRateUlNew" label="上行PRB平均利用率(%)" min-width="200" />
            <el-table-column prop="frruPrbUtilizeRateDlNew" label="下行PRB平均利用率(%)" min-width="200" />
            <el-table-column prop="frruPrbUtilizeRateF2" label="无线利用率(%)" min-width="200" />
            <el-table-column prop="frruRatioUl" label="上行用户平均速率(Mbps)" min-width="200" />
            <el-table-column prop="frruRatioDl" label="下行用户平均速率(Mbps)" min-width="200" />
            <el-table-column prop="cqiLt7Rate" label="CQI<7占比(%)" min-width="200" />
            <el-table-column prop="fphyMeanNlUl" label="小区RB上行平均干扰电平(dbm)" min-width="200" />
            <el-table-column prop="fphyMaxNlUl" label="小区RB上行最大干扰电平(dbm)" min-width="200" />
            <el-table-column prop="rrcConnNbrMean" label="RRC连接平均数(个)" min-width="200" />
            <el-table-column prop="rrcConnNbrMax" label="RRC连接最大数(个)" min-width="200" />
            <el-table-column prop="erabEstabAtt1" label="E-RAB建立请求数(QCI=1)(次)" min-width="200" />
            <el-table-column prop="erabEstabSucc1" label="E-RAB建立成功数(QCI=1)(次)" min-width="200" />
            <el-table-column prop="ferabSucEstRateQ1" label="E-RAB建立成功率(QCI=1)(%)" min-width="200" />
            <el-table-column prop="fwlsSucCallRateQ1" label="无线接通率(QCI=1)(%)" min-width="200" />
            <el-table-column prop="ferabDropRateQ1" label="E-RAB掉线率(QCI=1)(小区级)(%)" min-width="200" />
            <el-table-column prop="ferabDropRateQ1F2" label="E-RAB掉线率(QCI=1)(%)" min-width="200" />
            <el-table-column prop="rrcConnEstabAtt" label="RRC连接建立请求次数(次)" min-width="200" />
            <el-table-column prop="rrcConnEstabSucc" label="RRC连接建立成功次数(次)" min-width="200" />
            <el-table-column prop="frrcSucConEstRate" label="RRC连接建立成功率(%)" min-width="200" />
            <el-table-column prop="rrcConnNbrMeanEffective" label="有效RRC连接平均数(个)" min-width="200" />
            <el-table-column prop="rrcConnNbrMaxEffective" label="有效RRC连接最大数(个)" min-width="200" />
        </el-table>
    </index-card>
</template>

<script setup>
import { ref } from "vue";
import { apiCommon, formatDateNormal } from "@/utils/index.js";
import * as qualityApi from "@/api/biz/networkQuality";
import mittBus from "@/utils/mittBus"; // mitt事件总线

mittBus.on("get4GIndexItemData", (params) => {
    getData(params)
});

const props = defineProps({
    indexCardTitle: {
        type: String,
        default: '',
    },
    rowsData: {
        type: Object,
        default: () => { },
    },
});

const tableData = ref([]);
let loading = ref(false);

const getData = async (params) => {
    // console.log('params', params)

    loading.value = true;
    tableData.value = await apiCommon(qualityApi.getLteCapabilityBusyList, params);
    tableData.value = tableData.value.data;
    loading.value = false;
}

getData(props.rowsData);
</script>